// pages/calc/calc.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    count: 0
  },
  // ++
  increaseCount() {
    let num = this.data.count
    num++
    if (num > 5) {
      wx.showToast({
        icon: 'none',
        title: '再加就破产啦=_='
      })
      return
    }
    this.setData({
      count: num
    })
  },
  // --
  reduceCount() {
    let num = this.data.count
    num--
    if (num < 0) {
      wx.showToast({
        icon: 'none',
        title: '节俭好啊，节俭好啊~~'
      })
      return
    }
    this.setData({
      count: num
    })
  },
  goToCalcDetail() {
    wx.navigateTo({
      url: '/pages/calcDetail/calcDetail'
    })
  }
})